<script setup>
import { ref } from 'vue'
import ListView from '@/views/checkType/list.vue'
import ModifyView from '@/views/checkType/modify.vue'

const mref = ref(null)
const lref = ref(null)

const queryCheckTypeList = () => {
  lref.value.queryList()
}

const updateCheckType = (data) => {
  mref.value.formData = { ...data }
  mref.value.dialogVisible = true
}

const addCheckType = () => {
  mref.value.formData = { id: null, name: null, description: null, status: 1,code: null }
  mref.value.dialogVisible = true
}
</script>

<template>
  <div class="check-type-container">
    <h2>检验类型管理</h2>
    <ListView 
      ref="lref" 
      @update="updateCheckType" 
      @add="addCheckType" 
    />
    <ModifyView 
      @query="queryCheckTypeList" 
      ref="mref" 
    />
  </div>
</template>

<style scoped>
.check-type-container {
  padding: 20px;
}
h2 {
  margin-bottom: 20px;
  color: #333;
}
</style>